import _00GraphFuc as gf
import _000GraphBasicProblem as gb

#随机生成m*n图，并求关键路径
m,n=4,5
[V,E] = gf.MNgraph(m,n)
[V,Ew] = gf.weightedgraph(V,E,20)
[d, di, do] = gb.degreesetw(V, Ew)
v0,vn= 0,m*n-1
[Pc,Hx,Hy] = gb.craticalpath(V, Ew, di, do,v0, vn)
#[V,Ec]= gb.graphw2graph(V,Pc)
gf.drawdigraph(E)
#gf.drawdigraph(Ec)
print("Ew",Ew)
print("Hx",Hx)
print("Hy",Hy)
print(Pc)